/**
 *  Authors:
 *  Scott Renaud
 *  Kevin Carrington
 *  
 *  February 5 - 2012
 * 
 *  Team 4 - Iteration 1
 *  COMP 354 / Winter 2012
 *  
 *  =============================
 *  
 *  PersonHelper.java
 *  
 *  This is a helper class that allows us to check if a person's name
 *  is already associated with a Person object in the provided personList vector
 *  
 */

package taskManagmentSystem;

import java.util.Vector;

public class PersonHelper {
	
	private Person existingPerson;
	
	// Checks if the provided Person vector contains the given Person's name
	public Person personExists(String name, Vector<Person> personList)
	{
		existingPerson = null;
		
		if (!"".equals(name))
		{
			for (int j = 0; j < personList.size(); j++)
			{
				if (personList.get(j).getName().equalsIgnoreCase(name))
				{
					existingPerson = personList.get(j);
					break;
				}			  	  				
			}
		}
		return existingPerson;
	}

}
